package com.friends.utils.id;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 *  simpledateformat threadlocal
 *
 * @author Dark
 * @version 2023/03/18 15:01
 **/
public class DateFormatThreadLocal {
    private DateFormatThreadLocal() {
    }
    private static final ThreadLocal<SimpleDateFormat> DATE_FORMAT_THREAD_LOCAL = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMdd"));
    
    public static DateFormat getDateFormat() {
        return DATE_FORMAT_THREAD_LOCAL.get();
    }
    
    public static void remove() {
        DATE_FORMAT_THREAD_LOCAL.remove();
    }
}